import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'
import Login from '@/views/Login.vue'
import register from '@/views/register.vue'
import user from '@/views/user/index.vue'
import edito from '@/views/user/Edito.vue'
import concerns from '@/views/user/Concerns.vue'
import text from '../views/text.vue'
import collection from '@/views/user/Collection.vue'
import articlescoms from '../views/ArticlesComs.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/text',
    name: 'text',
    component: text
  },
  {
    path: '/articlescoms/:id',
    name: "articlescoms",
    component: articlescoms,
  },

  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/user',
    name: 'user',
    component: user,
    meta: {
      auth: true
    }
  },
  {
    path: '/edito',
    name: 'edito',
    component: edito,
    meta: {
      auth: true
    }
  },
  {
    path: '/concerns',
    name: 'concerns',
    component: concerns,
    meta: {
      auth: true
    }
  },
  {
    path: '/collection',
    name: 'collection',
    component: collection,
    meta: {
      auth: true
    }
  },
]

const router = new VueRouter({
  routes
})

export default router
